package cn.sciento.farm.cloud.config;

import cn.sciento.core.swagger.ChoerodonRouteData;
import cn.sciento.swagger.annotation.ChoerodonExtraData;
import cn.sciento.swagger.swagger.extra.ExtraData;
import cn.sciento.swagger.swagger.extra.ExtraDataManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;

@ChoerodonExtraData
public class FcmExtraDataManager implements ExtraDataManager {
    @Autowired
    private Environment environment;

    public FcmExtraDataManager() {
    }

    public ExtraData getData() {
        ChoerodonRouteData choerodonRouteData = new ChoerodonRouteData();
        choerodonRouteData.setName(this.environment.getProperty("stong.service.current.name", "fcm"));
        choerodonRouteData.setPath(this.environment.getProperty("stong.service.current.path", "/fcm/**"));
        choerodonRouteData.setServiceId(this.environment.getProperty("stong.service.current.service-name", "${stong.service.fcm.name:farm-cloud}"));
        choerodonRouteData.setPackages("cn.sciento.farm.cloud");
        extraData.put("choerodon_route", choerodonRouteData);
        return extraData;
    }
}

